{ci_language file="subject"}
{include file='overall_header.tpl'}

{if isset($error)}<p class="error">{ci_language line="{$error}"}</p>{/if}
{if isset($message)}<p class="message">{$message}</p>{/if}
{if isset($set_prerequisites)}
    {ci_form type="open" url='subject/prerequisites'}
    Add Prerequisites for Subject {ci_form type="dropdown" name="subject_id" options=$subjects value="{if isset($subject_id)}$subject_id{/if}"}
    
    <br /><br />
    {ci_form type="input" name="subject_prerequisites" id="subject_prerequisites" value=""}
    <br />
    {ci_form type="submit" name="action" value="submit"}
    
    {ci_form type="close"}
{elseif isset($add_subject_info)}
{ci_form type="open" url="subject"}
{ci_form type="fieldset" label="Add Subject Info"}
	{ci_form type="label" text="{ci_language line='subject_code'}:" id="subject_code"}
	{ci_form type="input" name="subject_code" id="subject_code" value="{ci_form_validation field='subject_code'}"}<br />
	{ci_form_validation field='subject_code' error='true'}

	{ci_form type="label" text="{ci_language line='subject_name'}:" id="subject_name"}
	{ci_form type="input" name="subject_name" id="subject_name" value="{ci_form_validation field='subject_name'}"}<br />
	{ci_form_validation field='subject_name' error='true'}

	{ci_form type="label" text="{ci_language line='subject_description'}:" id="subject_description"}
	{ci_form type="input" name="subject_description" id="subject_description" value="{ci_form_validation field='subject_description'}"}<br />
	{ci_form_validation field='subject_description' error='true'}

	{ci_form type="label" text="{ci_language line='subject_unit'}:" id="subject_unit"}
	{ci_form type="input" name="subject_unit" id="subject_unit" value="{ci_form_validation field='subject_unit'}"}<br />
	{ci_form_validation field='subject_unit' error='true'}
    
    {ci_form type="submit" name="action" value="submit"}

{ci_form type="close"}
{elseif isset($show_prerequisite)}
{ci_form type="open" url='subject/show_prerequisite'}
    Show Prerequisites for Subject {ci_form type="dropdown" name="subject_id" options=$subjects value="{if isset($subject_id)}$subject_id{/if}"}
    {ci_form type="submit" name="action" value="submit"}
{ci_form type="close"}
{if isset($prerequisite_subjects)}
    {foreach from=$prerequisite_subjects item=subject}
        {$subject->getSubjectInfo()->getSubjectInfoCode()} - {$subject->getSubjectInfo()->getSubjectInfoName()} <br />
    {/foreach}
{/if}

{/if}
{include file='overall_footer.tpl'}